home *** CD-ROM | disk | FTP | other *** search
-
- {$M 1024,0,0} {use the smallest memory possible}
- {$F+,R-} {we want this to be FAR}
-
- {BINDEMO2 V1.01 Copyright 1989 Michael Day as of 16 April 1989}
- {all rights reserved}
- PROGRAM BinDemo2;
- uses DOS,BinIpc;
-
- var Dbs : string;
- Pass : integer;
-
- {$F+}
- procedure DoHello; {Re-entrancy procedure - do not call from main program}
- begin
- SwapVectors;
- writeln('Hello again from the BIN Program: ',Pass);
- inc(Pass);
- SwapVectors;
- end;
-
- procedure Pad(var S:string);
- begin
- while length(S) < pred(sizeof(S)) do
- S := S+' ';
- end;
-
- begin
- if IPC = nil then
- begin
- writeln('Hey, you''re trying to run this from DOS. No can do.');
- halt(1);
- end;
- BinLoadCheck;
- writeln('We are now inside the BIN program');
- Pass := 1;
- if GetDbString(DbS) then
- begin
- writeln(Dbs);
- Dbs := 'This is a message passed back to the database program';
- Pad(Dbs);
- if SetDbString(DbS) then {nop};
- end;
-
- SetBinEntry(DoHello); {set new entry point}
- SwapVectors; {restore the vectors}
- Keep(0); {keep things around}
- end.
-